home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / PORTABLE.ZIP / BEEP.C < prev    next >
Text File  |  1992-11-21  |  2KB  |  50 lines

  1. #define        CURSES_LIBRARY  1
  2. #include <curses.h>
  3. #undef beep
  4.  
  5. #ifndef        NDEBUG
  6. char *rcsid_beep = "$Header: c:/curses/portable/RCS/beep.c%v 2.0 1992/11/15 03:29:34 MH Rel $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12. /*man-start*********************************************************************
  13.  
  14.   beep()       - generate audio-visual alarm.
  15.  
  16.   X/Open Description:
  17.        This routine is used to signal the terminal user.  The beep()
  18.        function will sound the audible bell on the terminal, if possible
  19.        and if not, will flash the screen (visible bell), if possible.
  20.        The flash() function will flash the screen, and if that is not
  21.        possible, will sound the audible signal.  If neither signal is
  22.        possible, nothing will happen.  Nearly all terminals have an
  23.        audible signal (bell or beep), but only some can flash the screen.
  24.  
  25.   X/Open Return Value:
  26.        The beep() and flash() functions return OK on success and ERR on
  27.        error.
  28.  
  29.   X/Open Errors:
  30.        No errors are defined for this function.
  31.  
  32.   Portability:
  33.        PDCurses        int beep( void );
  34.        X/Open Dec '88  int beep( void );
  35.        BSD Curses      int beep( void );
  36.        SYS V Curses    int beep( void );
  37.  
  38. **man-end**********************************************************************/
  39.  
  40. int    beep(void)
  41. {
  42.        if (!_cursvar.audible)
  43.        {
  44.                flash();
  45.                return( ERR );          /* We try to flash instead...*/
  46.        }
  47.        PDC_putctty( '\007', 0 );
  48.        return( OK );
  49. }
  50.